#!/bin/bash
#
# This script (M100) is called to log the current coordinates and the
# current tool number and Tool Length Offset information to a log file,
# for testing purposes
#

TEST_DIR=$(dirname INI_FILE_NAME)
OUT_FILE=$TEST_DIR/gcode-output

P=$1
Q=$2

#echo P is $P >> $OUT_FILE
#echo Q is $Q >> $OUT_FILE

case $P in
    0.000000) echo "X = $Q" >> $OUT_FILE;;
    1.000000) echo "Y = $Q" >> $OUT_FILE;;
    2.000000) echo "Z = $Q" >> $OUT_FILE;;
    3.000000) echo "toolno = $Q" >> $OUT_FILE;;
    4.000000) echo "tlo_z = $Q" >> $OUT_FILE;;
    5.000000) echo "" >> $OUT_FILE;;
    6.000000) echo "sequence number $Q" >> $OUT_FILE;;
    *)
        echo "unknown P=$P (Q=$Q)" >> $OUT_FILE
        exit 1;;
esac

